﻿using MediatR;
using SystemLYH.API.Application.Command.LocationCommand;
using SystemLYH.Domain;
using SystemLYH.Infrstructre.Interface;

namespace SystemLYH.API.Application.Handlers.LocationHandlers
{
    public class LocationBackfillHandlers : IRequestHandler<LocationBackfillCommand, Location>
    {
        protected readonly ILocationRepository _locationRepository;
        /// <summary>
        /// 库位构造函数
        /// </summary>
        /// <param name="locationRepository"></param>
        public LocationBackfillHandlers(ILocationRepository locationRepository)
        {
            _locationRepository = locationRepository;
        }
        public async Task<Location> Handle(LocationBackfillCommand request, CancellationToken cancellationToken)
        {
            return await _locationRepository.GetAsync(request.LocationId);
        }
    }
}
